home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
www
/
amitrix
/
awebdl.lha
/
AWebDL.awebrx
next >
Wrap
Text File
|
1998-01-27
|
2KB
|
115 lines
/*
$VER: AWebDL 2.1 (15.12.97) by Gabriele Favrin (favrin@tin.it)
Download script for AWeb 3.0+
See documentation for informations!
*/
options results
log = ""
url = ""
req = 0
savedir = ""
eol = '0A'x
append = ""
chars = '`~"=#?/:;\*%()[]<>'||"'"
parse ARG args
interpret translate(strip(args), ';',' ')
savedir=translate(savedir, ' ', ';')
If Right(savedir, 1) ~= "/" & Right(savedir, 1) ~= ":" then do
savedir=savedir"/"
end
file=Translate(url,,chars)
file=savedir||Word(file, Words(file))
If Exists(file) then do
If req == 1 then do
Call ShowReq()
end
else do
Call AutoName()
end
end
'LOAD "'url'" SAVEAS "'file'"' append
If log ~= "" then do
call SaveLog()
end
exit 0
AutoName:
num = 2
do while Exists(file||'.'num)
num=num+1
end
file=file||'.'||num
return
SaveLog:
log=translate(log, ' ', ';')
If exists(log) then do
wflag="A"
end
else do
wflag="W"
end
If Open(fh, log, wflag) then do
Call WriteCH(fh, 'File: 'file||eol||'URL : 'translate(url, ' ', ';')||eol||'Date: 'date()", "time()||eol||eol)
Call Close(fh)
end
return
ShowReq:
flag=0
do while flag == 0
'Request "AWebDL" "File:*N'file'*NAlready exists!" "_Overwrite|_Append|Auto _rename|_New name|_Cancel"'
If rc == 5 then do
exit 0
end
else do
select
when result == 1 then flag=1
when result == 2 then do
drop append
flag=1
end
when result == 3 then do
Call AutoName()
flag=1
end
when result == 4 then do
'RequestFile "AWebDL - select new file name" FILE 'file' SAVEMODE'
If rc == 5 then do
exit 0
end
else do
If ~exists(result) then do
file=result
flag=1
end
end
end
otherwise nop
end
end
end
return